package sample;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
import jfxtras.styles.jmetro.JMetro;
import jfxtras.styles.jmetro.Style;
import sample.context.StageManager;

public class Main extends Application {

    @Override
    public void start(Stage primaryStage) throws Exception{
        Parent root = FXMLLoader.load(getClass().getClassLoader().getResource("loginView.fxml"));
        primaryStage.setTitle("ChatROOM");

        Scene scene = new Scene(root, 650, 400);
        scene.getStylesheets().add(getClass().getClassLoader().getResource("application.css").toExternalForm());
        JMetro jMetro = new JMetro(Style.LIGHT);
        jMetro.setScene(scene);
        primaryStage.setScene(scene);

        primaryStage.show();

        //将第二个窗口保存到map中
        StageManager.STAGE.put("LoginView", primaryStage);
    }

    public static void main(String[] args) {
        launch(args);
    }
}
